

import testFileRW.FileIn;
import testFileRW.FileOut;

public class gerUser {
	public static void main(String[] args) {
		// get web sites
		FileIn in = new FileIn();
		in.openFile("user728raw.txt");

		String line = null;
		String [] tmpArray = null;
		String tmp = null;
		line = in.readLine();
		int count = 0;
		while (line != null) {
			tmpArray = line.split(" ");
			//p(tmpArray.length);
			//10
			if(tmpArray.length>10){
				//9 10
				tmp = tmpArray[9]+" "+tmpArray[10];
			if (!exist(tmp,"user728.txt",0)) {
				count++;
				FileOut out = new FileOut();
				out.writeaLine(tmp+";"+count,"user728.txt");
			}
			}
			line = in.readLine();
		}
		in.closeFile();
	}

	public static boolean exist(String str,String file,int pos) {
		boolean b = false;
		FileIn check = new FileIn();
		check.openFile(file);
		String tmp = null;
		tmp = check.readLine();
		//p("check "+tmp);
		while (tmp != null) {
			if (str.indexOf((tmp.split(";")[pos]))==0) {
				b = true;
				break;
			}
			tmp = check.readLine();
		}
		check.closeFile();
		p(b);
		return b;
	}
	
	public static void p(Object o){
		System.out.println(o.toString());
	}
}
